#include <stdio.h>
char* my_strstr(const char* p1, const char* p2)
{
	const char* temp = p1;
	const char* str = p2;
	const char* ret = p1;
	if (*str == '\0')
	{
		return NULL;
	}
	while (*ret)
	{
		ret = temp;
		while (*temp == *str)
		{
			if (*str == '\0')
				break;
			temp++;
			str++;
		}
		if (*str == '\0')
			return (char*)ret;
		str = p2;
		temp = ++ret;
	}
	return NULL;
}
int main()
{
	char* str1 = "hello world";
	char* str2 = "world";
	char* ret = 0;
	ret = my_strstr(str1, str2);
	printf("%s\n", ret);
	return 0;
}